<%@ include file="../common/common_include.jsp"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	List<TblSiteNews> list = (List<TblSiteNews>)request.getAttribute("list");
	SiteForm form = (SiteForm)request.getAttribute("command");
	String isimportant = StringUtils.isNotBlank(form.getIsimportant())?form.getIsimportant():"";
	String istop = StringUtils.isNotBlank(form.getIstop())?form.getIstop():"";
	String group = StringUtils.isNotBlank(form.getGroup())?form.getGroup():Constants.NEWS_GROUP_GONGSI;
	String isShow = StringUtils.isNotBlank(form.getIsShow())?form.getIsShow():"";
%>

<table class="tableList">

	<thead>
		<tr>
			<td colspan="5" style="width: 100%;">
				<div class="FormTools">
					<div>
						<input id="keywords" type="text" name="keywords" class="search"
							placeholder="请输入标题关键字"
							value="<%=StringUtils.isNotBlank(form.getTitle())?form.getTitle():""%>" />
						<input type="button" class="searchSubmit" value="搜索"
							onclick="javascript:XF.Site.searchNews()" />
					</div>
					<div>
						重要 <select id="isimportant" name="isimportant" rel="selectGO">
							<option value=""
								<%=isimportant.equalsIgnoreCase("")?"selected=selected":""%>>全部</option>
							<option value="1"
								<%=isimportant.equalsIgnoreCase("1")?"selected=selected":""%>>是</option>
							<option value="0"
								<%=isimportant.equalsIgnoreCase("0")?"selected=selected":""%>>否</option>
						</select>
					</div>
					<div>
						置顶 <select id="istop" name="istop" rel="selectGO">
							<option value=""
								<%=istop.equalsIgnoreCase("")?"selected=selected":""%>>全部</option>
							<option value="1"
								<%=istop.equalsIgnoreCase("1")?"selected=selected":""%>>是</option>
							<option value="0"
								<%=istop.equalsIgnoreCase("0")?"selected=selected":""%>>否</option>
						</select>
					</div>
					<div>
						发布
						<select id="isShow" name="isShow" rel="selectGO">
							<option value=""
								<%=isShow.equalsIgnoreCase("")?"selected=selected":""%>>全部</option>
							<option value="1"
								<%=isShow.equalsIgnoreCase("1")?"selected=selected":""%>>已发布</option>
							<option value="0"
								<%=isShow.equalsIgnoreCase("0")?"selected=selected":""%>>未发布</option>
						</select>
					</div>
				</div>
			</td>
		</tr>
	</thead>

	<tbody>
		<tr id="tableHeader">
			<th style="width: 10%;">来源</th>
			<th style="width: 43%;">标题</th>
			<th style="width: 15%;">发布人</th>
			<th style="width: 18%;">发布时间</th>
			<th style="width:14%;">操作</th>
		</tr>
		<%
          	if(null!=list && list.size()>0){
          		for(TblSiteNews news:list){
          			String id = EncrypTool.encode(news.getId()+"");
          			%>
		<tr>
			<td><%=StringUtils.isNotBlank(news.getNewsSource())?news.getNewsSource():""%></td>
			<td style="text-align: left; padding-left: 10px;">
			<a name="toRead" href="javascript:XF.Site.detail('<%=id%>')"><%=news.getTitle()%></a></td>
			<td><%=StringUtils.isNotBlank(news.getPublicMan())?news.getPublicMan():""%></td>
			<td><%=null!=news.getPublicTime()?DateFormatUtils.format(news.getPublicTime().getTime(), "yyyy-MM-dd HH:mm:ss"):"" %></td>
			<td>
				<div class="innerBtnWrap">
					<a class="a-btn-microsoft btn" href="javascript:XF.Site.editNews('<%=id %>')">编辑</a>
					<a class="a-btn-microsoft btn topBtn" href="javascript:XF.Site.deleteNews('<%=id %>','<%=group %>')">删除</a>
				</div>
			</td>
		</tr>
		<%
           		}
           	}
        %>
         <tr>
		<%
			for(int i=0;i<5;i++){
				%><td style="height:0"/><%
			}
		%>
		</tr>
	</tbody>

	<tfoot>
		<tr id="tableFooter">
			<td colspan="5">
				<div class="pagination">
					<monggoTag:pagination href="news_search"
						pageSize="<%=form.getPageSize()%>"
						totalRecord="<%=form.getTotalRecord() %>"
						currentPage="<%=form.getPageNum() %>">
					</monggoTag:pagination>
				</div>
			</td>
		</tr>
	</tfoot>
</table>

<script>
	$(function() {
		XF.Site.searchNewsByGroupAfterHanlder("<%=group%>");
		XF.Site.init();
		XF.Site.init_css();
	
	});
</script>
































